define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'user.address/index',
        add_url: 'user.address/add',
        edit_url: 'user.address/edit',
        delete_url: 'user.address/delete',
        export_url: 'user.address/export',
        modify_url: 'user.address/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'id'},
                    {field: 'uid', title: '用户id'},
                    {field: 'name', title: '收货人'},
                    {field: 'phone', title: '收货人手机号'},
                    {field: 'province_region', title: '地区省'},
                    {field: 'city_region', title: '城市'},
                    {field: 'district_region', title: '区县'},
                    {field: 'detailed_address', title: '详细地址'},
                    {field: 'is_default', title: '是否默认 0默认 1不默认'},
                    {width: 100, title: '操作', templet: ea.table.tool},

                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});